package com.aatattoo.light_food_service.service;

import com.aatattoo.light_food_service.entity.Reply;
import com.aatattoo.light_food_service.mapper.ReplyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author aatattoo
 * @Date 2021/12/14 9:25 上午
 * @msg:
 */
@Service
@Component
public class ReplyService {
    @Autowired
    private ReplyMapper replyMapper;

    public int addReply(Reply reply){
        replyMapper.addReply(reply);
        return reply.getId();
    }

    public int deleteByComent(int commentId){
        return replyMapper.deleteByComent(commentId);
    }

    public int deleteById(int id){
        return replyMapper.deleteById(id);
    }

    public List<Reply> findeByComentId(int commentId){
        return replyMapper.findeByComentId(commentId);
    }

    public int countRemind(int userId){
        return replyMapper.countRemind(userId);

    }

    public int countReply(int commentId){
        return replyMapper.countReply(commentId);
    }


    public int updataRemind(int userId){
        return replyMapper.updataRemind(userId);
    }

    public List<Reply> findActiveByUserId(int userId){
        return replyMapper.findActiveByUserId(userId);
    }

    public List<Reply> findPassiveByUserId(int userId){
        return replyMapper.findPassiveByUserId(userId);
    }

    public Reply findById(int id){
        return replyMapper.findById(id);
    }
}
